package com.xywy.wjk.widget;

import com.xywy.R;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.Toast;

public class TestingDialog {
	static Dialog dialog;
    public static void showFloowDialog(final Context context){
    	if(dialog ==null)
        dialog = new Dialog(context,R.style.Dialog_Style);
        WindowManager wm = (WindowManager) context.getSystemService(context.WINDOW_SERVICE);
        int width = wm.getDefaultDisplay().getWidth();
        int height = wm.getDefaultDisplay().getHeight();
        LayoutParams params = new LayoutParams(new LayoutParams(width,height));
    	LinearLayout linearLayout = new LinearLayout(context);
    	linearLayout.setBackgroundColor(0x00000000);
    	dialog.setContentView(linearLayout,params);
//    	LinearLayout lin = (LinearLayout) dialog.findViewById(R.id.lin);
    	linearLayout.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				 Toast.makeText(context, "正在测量请稍候", Toast.LENGTH_SHORT).show();
			}
		});
    	dialog.setCancelable(false);
    	dialog.setCanceledOnTouchOutside(false);
    	dialog.show();
    }
    
    public static void dismissFloowDialog(){
    	if(dialog != null && dialog.isShowing())
    		dialog.dismiss();
    }
}
